def bubble_sort(array):
    n=len(array)
    for i in range(n-1,0,-1):
        swapped=False
        for j in range(i):
            if array[j] > array[j+1]:
                array[j],array[j+1]=array[j+1],array[j]
                swapped=True
        if not swapped:
            break

array=[14,33,27,35,10]
print(array)
bubble_sort(array)
print(array)
